home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
5_9.lha
/
5_9
/
5_9b5.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
548b
|
30 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ Rewrite of Section 5.2.5
oid f()
// char_stack s1(100);
char_stack s1;
set_cs(s1, 100);
// char_stack s2(200);
char_stack s2;
set_cs(s2, 200);
// s1.push('a');
push_cs(s1, 'a');
// s2.push(s1.pop());
push_cs(s2, pop_cs(s1));
// char ch = s2.pop();
char ch = pop_cs(s2);
cout << chr(ch) << "\n";
// implicit destructor
delete_cs(s1);
delete_cs(s2);